package org.ftc.util;

import java.io.IOException;
import java.net.MalformedURLException;

import javax.xml.parsers.ParserConfigurationException;

import org.ftc.service.LoadUserDataTaskService;
import org.ftc.service.ValidationTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.xml.sax.SAXException;

@Component
public class RunValidationTask {
	
	@Autowired
	private ValidationTaskService validationTaskService;
	
	@Autowired
	private LoadUserDataTaskService loadUserService;
	
	@Scheduled(fixedDelay = 180000 )
	public void validation() {
		validationTaskService.validation();
	}
	
	@Scheduled(cron="0 0 18 * * *" )
	public void loadUser() {
		try {
			loadUserService.update();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
